#include "buzzer.h"
#include "peripheral.h"

void buzzer_active(u16 ms)
{
  tim_set_pwm_buzzer(500);
  delay_ms(ms);
  tim_set_pwm_buzzer(0);
}


void buzzer_on(void)
{
  tim_set_pwm_buzzer(500);
}

void buzzer_off(void)
{
  tim_set_pwm_buzzer(0);
}

/* 响5声，作为提示音 */
void buzzer_tip(void)
{
	buzzer_active(100);
  delay_ms(100);

	buzzer_active(100);
  delay_ms(100);
	
	buzzer_active(100);
  delay_ms(100);
	
	buzzer_active(100);
  delay_ms(100);
	
	buzzer_active(100);
  delay_ms(100);
}


